﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="List.ascx.vb" Inherits="Control_HotelReport_List" %>
<%@ Register TagPrefix="aspNewControls" Namespace="NewControls" %>
<script type='text/javascript'>
    function ajaxJquery() {
        $(function () {


            $("#<%=txtMaKS.ClientID %>").keyup(function () {
                $(this).val($(this).val().toUpperCase());
                $("#<%=ddlKhachSan.ClientID %>").val($(this).val());
            });

            $("#<%=ddlKhachSan.ClientID %>").change(function () {

                if ($(this).val() != "-1") {
                    $("#<%=txtMaKS.ClientID %>").val($(this).val());
                }
                else {
                    $("#<%=txtMaKS.ClientID %>").val("");
                }
            });



            $(".Date").datepicker({ dateFormat: 'dd/mm/yy' });
            var url = '<%= ConfigurationManager.AppSettings("MainDomain") %>';

            $(".SubjectTitle input, .SubjectTitle select").keypress(function (e) {
                if (e.keyCode == 13) {
                    $("#<%=btnFilter.ClientID()%>").click();
                    return false;
                }
            });

            //check cookie to show or hide search pannel
            if ($.cookie('CookieSiteSearch') == 1) {
                $('#pnlSearch').show();
                $('#imgShowHide').attr("src", url + "images/arrow_popup.gif");
            }
            else {
                $('#pnlSearch').hide();
                $('#imgShowHide').attr("src", url + "images/arrow_showless.gif");
            }


            $('#B1').click(function (event) {

                //set cookie
                if ($.cookie('CookieSiteSearch') == 1) {
                    $.cookie('CookieSiteSearch', 0)
                }
                else {
                    $.cookie('CookieSiteSearch', 1)
                }
                $('#pnlSearch').slideToggle(500);
                if ($('#imgShowHide').attr("src") == url + "images/arrow_popup.gif") {
                    $('#imgShowHide').attr("src", url + "images/arrow_showless.gif");
                }
                else {
                    $('#imgShowHide').attr("src", url + "images/arrow_popup.gif");
                }
            });


        });



    }


    function confirmMultiDelete(strID) {
        var grdShow = document.getElementById("<%=grdShow.ClientID %>");
        var count = 0;
        for (i = 1; i < grdShow.children.item(0).children.length; i++) {
            if (grdShow.children.item(0).children.item(i).children.item(0).children.item(0).checked) {
                count += 1;
            }
        }
        if (count > 0) {
            return ComfirmDialog('<%=drpMessage.Items(1).Text%>', 0, strID, 0, 0);
        } else {
            Alertbox('<%=drpMessage.Items(2).Text%>');
            return false;
        }
    }

    function ComfirmDialog(strText, value, ObjectIdClick, ID, Type) {

        if (value == 0) {
            Confirmbox(strText, value, ObjectIdClick, ID, Type);
            return false;
        } else {
            if (Type == 1) {

                document.getElementById('<%=hidID.ClientID %>').value = ID;
                eval($("#" + ObjectIdClick + "").attr("href"));
            }
            else {

                document.getElementById('<%=hidID.ClientID %>').value = ID;
                $("#" + ObjectIdClick + "").click();
            }
        }
    }




</script>
<asp:UpdatePanel ID="uplHotelReport" runat="server">
    <contenttemplate>
    <br />
    <div  class="Header">   
        <h3>DANH SÁCH KHÁCH SẠN REPORT </h3>
    </div>

        <div class="SubjectTitle" id="SInfor" runat="server">
            <legend class="SubjectTitle">
                <img alt="" src="" id="imgShowHide" />
                <a id="B1" href="#">Tìm kiếm </a>&nbsp;&nbsp;</legend>
        </div>
              

         <div id="pnlSearch" class="SubjectTitle">

            <div>
                    <div class="DivLeft">
                              <asp:Label ID="Label3" CssClass="TextLabel" runat="server" Text="Mã CSLT:" />
                    </div>

                    <div class="DivRight">
                     <asp:TextBox ID="txtMaKS" CssClass="TextBox" runat="server" Text="" Width="80px" MaxLength="10" />     
                        <asp:DropDownList ID="ddlKhachSan" CssClass="DropDownList" runat="server" />
                    </div>
            </div>


            <div class="DivRow">
                <div class="DivLeft">
                    <asp:Label ID="Label1" CssClass="TextLabel" runat="server" Text="Loại CSLT:" />
                </div>
                <div class="DivRight">
                    <asp:DropDownList ID="ddlLoaiCSLT" CssClass="DropDownList" runat="server" />
                </div>
            </div>
            <div class="DivRow">
                <div class="DivLeft">
                    <asp:Label ID="Label4" CssClass="TextLabel" runat="server" Text="Loại người dùng:" />
                </div>
                <div class="DivRight">
                    <asp:DropDownList ID="ddlLoaiNguoiDung" CssClass="DropDownList" runat="server" />
                </div>
            </div>


                                         


        <div class="DivRow">
                    <div class="DivLeft">
                            <asp:Label ID="Label433" CssClass="TextLabel" runat="server" Text="Tên người dùng:" />
                    </div>
                    <div class="DivRight">
                        <asp:TextBox ID="txtUserName" CssClass="TextBox" runat="server" Text="" />
                    </div>
            </div>
   		
            <div class="DivRow">
                <div style="width: 620px; float: left">
                    <div style="float: left" class="DivLeft">
                        <asp:Label ID="lblTerminate_date_edit" runat="server" Text="Từ ngày: " CssClass="TextLabel" />
                    </div>
                    <div style="width: 18%; float: left; padding-left: 0px !important">
                        <asp:TextBox ID="txtTuFromDate" CssClass="TextBox Date" Width="106px" runat="server"
                            Text="" />
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtTuFromDate"
                            Display="None" ErrorMessage="Ngày không đúng định dạng" ValidationExpression="^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/((19|[2-9]\d)\d{2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((19|[2-9]\d)\d{2}))|((0[1-9]|1\d|2[0-8])\/02\/((19|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$"></asp:RegularExpressionValidator>
                    </div>
                    <div style="width: 5%; float: left;padding-left:10px;">
                        <asp:Label ID="lblRate_edit4" runat="server" Text="đến" CssClass="TextLabel" />
                    </div>
                    <div style="width: 18%; float: left">
                        <asp:TextBox ID="txtDenFromDate" CssClass="TextBox Date" Width="106px" runat="server"
                            Text="" />
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" ControlToValidate="txtDenFromDate"
                            Display="None" ErrorMessage="Ngày nhập không đúng định dạng" ValidationExpression="^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/((19|[2-9]\d)\d{2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((19|[2-9]\d)\d{2}))|((0[1-9]|1\d|2[0-8])\/02\/((19|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$"></asp:RegularExpressionValidator>
                    </div>
                </div>
            </div>
            


             <div class="DivRow">
                    <div class="DivLeft">&nbsp;
                    </div>
                    <div class="DivRight">
                        <asp:Button ID="btnFilter" runat="server" Text='Tìm kiếm' CssClass='btn' />
                        <asp:Button ID="bnReset" runat="server" Text='Đặt lại' CssClass='btn' CausesValidation="false" />
                    </div>
             </div>

         </div>


    
    <asp:GridView ID="grdShow" runat="server" AutoGenerateColumns="False" EmptyDataText="{Không có dữ liệu}"
		   AllowPaging="false"   Width='100%' BorderWidth="1px" CssClass="GridBorder">
		    <Columns>
		<asp:TemplateField>
		    <HeaderTemplate>
			        <asp:CheckBox ID="CheckAll" runat="server" onclick="CheckAll(this);"  Width="30px" />
		    </HeaderTemplate>
		    <HeaderStyle HorizontalAlign="Center" />
		     <ItemTemplate>
			        <asp:CheckBox ID="chkItem" runat="server" />
		     </ItemTemplate>
		     <ItemStyle Width="5%" HorizontalAlign="Center" />
		 </asp:TemplateField>
	<asp:TemplateField>
	<ItemTemplate>
		   <asp:HyperLink ID="hplEdit" runat="server" Text="Sửa" Visible="false"></asp:HyperLink>
		   <asp:LinkButton ID="lnkbtnDelete" Text="Xóa" runat="server" OnClick="lnkbtnDelete_Click"
			       CausesValidation='False'></asp:LinkButton>
	</ItemTemplate>
	<ItemStyle CssClass="GridTextLink" HorizontalAlign="Center" Width="10%" />
	</asp:TemplateField>
	<asp:TemplateField HeaderText="No">
		  <ItemTemplate>
			    <asp:Label runat="server" ID="lblSTT" Text=''></asp:Label>
	 </ItemTemplate>
		  <ItemStyle Width="8%"  HorizontalAlign="Left" />
	</asp:TemplateField>
    		 <asp:TemplateField HeaderText='Mã CSLT'>
		  <ItemTemplate>
			    <asp:HyperLink ID="hplHotelCode" runat="server"></asp:HyperLink>
		 </ItemTemplate>
		 <ItemStyle Width='15%' CssClass='text_list_links' HorizontalAlign='Left' />
		</asp:TemplateField>

		 <asp:TemplateField HeaderText='Tên CSLT'>
		  <ItemTemplate>
			    <asp:HyperLink ID="hplHotelname" runat="server"></asp:HyperLink>
		 </ItemTemplate>
		 <ItemStyle Width='35%' CssClass='text_list_links' HorizontalAlign='Left' />
		</asp:TemplateField>

		 


		 <asp:BoundField DataField='DateReport' HeaderText='Ngày report' DataFormatString="{0:dd/MM/yyyy}">
			 <ItemStyle  Width='20%' />
		 </asp:BoundField>



		 <asp:BoundField DataField='Note' HeaderText='Ghi chú' >
			 <ItemStyle  Width='20%' />
		 </asp:BoundField>


	</Columns>
	 <HeaderStyle Height="26px" HorizontalAlign="Left" CssClass="GridHeader" />
	 <RowStyle CssClass="GridRow" Height="23px" />
	 <AlternatingRowStyle CssClass="GridAlterRow" />
	 <PagerStyle CssClass="GridPaged" HorizontalAlign="Right" Height="23px" />
	 <PagerSettings Mode="Numeric" PageButtonCount="2" />
	 <EmptyDataRowStyle CssClass="GridTextEmpty" HorizontalAlign="Center" />
	</asp:GridView>
	<div>
        <asp:Button ID="btnDelete" CssClass="btn" runat="server" Text="Xóa" /> <asp:Label ID="lblPage_Size" runat="server" Text="Số bản ghi trên trang:" ></asp:Label>		
         <asp:DropDownList ID="drpPage_Size" runat="server" AutoPostBack="True" Width="70px" CssClass="input_form">
		     <asp:ListItem Text="10" Value="10"></asp:ListItem>
		     <asp:ListItem Text="20" Value="20"></asp:ListItem>
		     <asp:ListItem Text="50" Value="50"></asp:ListItem>
		     <asp:ListItem Text="100" Value="100"></asp:ListItem>
		 </asp:DropDownList>
		  <asp:Label ID="lblTotal" runat="server"></asp:Label>
  </div>
	<div style="width: 99%">
		 <!--phan trang-->
		 <div id="results_resultsNavigationDiv" class="paginationEMP">
		 <ul>
		     <asp:LinkButton ID="lnkFirst" runat="server"></asp:LinkButton>
		     <asp:Repeater ID="rptPage" runat="server">
		         <ItemTemplate>
		              <asp:LinkButton ID="lnkTitle" CssClass="page_num" runat="server" OnClick="lnkTitle_Click"></asp:LinkButton>
		         </ItemTemplate>
		    </asp:Repeater>
		    <asp:LinkButton ID="lnkLast" runat="server"></asp:LinkButton>
		   </ul>
		  </div>
		  <asp:HiddenField ID="hidCount" Value="0" runat="server" />
		 <asp:HiddenField ID="hidIndex_page" Value="0" runat="server" />
		 <asp:HiddenField ID="hidCur_Page" Value="1" runat="server" />
		  </div>
	<div style='display: none'>
	<asp:DropDownList ID="drpMessage" runat="server" >
		  <asp:ListItem Text='Bạn có chắc chắn muốn xóa bản ghi này không?' Value='0'></asp:ListItem>
		   <asp:ListItem Text='Bạn có chắc chắn muốn xóa bản đã chọn?' Value='1'></asp:ListItem>
	 <asp:ListItem Text='Bạn phải chọn ít nhất một bản ghi.' Value='2'></asp:ListItem>
	</asp:DropDownList>
	 <asp:HiddenField ID="hidID" Value="0" runat="server" />
	</div>
	</contenttemplate>
</asp:UpdatePanel>
